#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: henry_oulen
@file: make_icon.py
@time: 2023/8/25 15:00
@desc: 
"""


import base64

#
# path = "E:\\project\\Code_2022\\Python_Coding\\Fishing_Calendar\\json_tool\\background.jpg"
# with open(path, "rb") as i:
#     b64str = base64.b64encode(i.read())
# with open("background.py", "ab+") as f:
#         f.write(b64str)
#         print(b)
# with open("icon.py", "a") as f:
#     f.write("'")
path = "E:\\project\\Code_2022\\Python_Coding\\Fishing_Calendar\\json_tool\\background.jpg"
with open(path, "rb") as i:
    b64str = base64.b64encode(i.read())
    print(b64str)
with open("icon.py", "w") as f:
    f.write('class Icon(object):\n')
    f.write('\tdef __init__(self):\n')
    f.write("\t\tself.img='%s'"%b64str)